package com.neusoft.neuiotms.dcam.fixed.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 资产卡片（总行）
 *
 * @author 孙长富
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "ah_asset_card")
@org.hibernate.annotations.Table(appliesTo = "ah_asset_card", comment = "资产卡片（总行）表")
public class AhAssetCard extends AbstractAuditModel {

    private static final long serialVersionUID = 1L;

    /** 卡片编号 */
    @NotBlank(message = "卡片编号不能为空")
    @Length(max = 255, message = "卡片编号不能超过{max}位")
    @Column(length = 255, nullable = false, unique = true)
    private String code;

    /** 应有资产数量 */
    private long amount = 0;

    /** 说明 */
    @Length(max = 255, message = "描述不能超过{max}位")
    @Comment("varchar(255) NULL DEFAULT NULL COMMENT '描述'")
    private String description;

}
